package tower.ai.base;

import org.springframework.ai.document.Document;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import tower.ai.base.chat.service.OllamaEmbedService;

import java.util.List;

@Configuration
@EnableAutoConfiguration
@ComponentScan(basePackages="tower.ai.base.chat")
public class ChatApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext ctx = SpringApplication.run(ChatApplication.class, args);
        OllamaEmbedService ollamaEmbedService =ctx.getBean(OllamaEmbedService.class);
        List<Document> list =  ollamaEmbedService.test();
        System.out.println("-----list-----" + list.size());
        list.forEach(System.out::println);
        System.out.println("-----完成-----");
        ctx.close();
    }

}
